<template>
	<List :title="titleName" @onClickLeft="onClickLeft"></List>
</template>
<script>
	import List from '@/view/forum/list.vue'
	export default {

		head() {
			return {
				title: this.titleName,
				backPath: '',
			}
		},
		data() {
			return {
				titleName: '问答社区'
			}
		},
		onLoad(query) {
			this.query = query
			this.siteMenuSourse = query.dataSource || ''
			let {
				dataSource,
				siteType,
				isBack
			} = query
			let type = siteType || (dataSource === '1' ? 'S' : 'D')
			this.siteType = isBack ? type : (this.loginSiteType || type)
		},
		beforeRouteEnter(to, from, next) {
			console.log("=>(list.vue:163) from", from);
			next(vm => {
				if (!from.name) {
					vm.backPath = 'index'
				}
				if (from.name === 'user' || from.name === 'index') {
					vm.backPath = from.name
				}
			})
		},
		computed: {},
		components: {
			List
		},
		mounted() {
			console.log("问答社区初始化页面")
		},
		methods: {
			onClickLeft() {
				console.log("=>(forum.vue:41) this.backPath", this.backPath);
				this.$uniPush({
					name: this.backPath || 'index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>